package com.xx566.blog.controller;

import com.jfinal.core.Controller;
import com.jfinal.upload.UploadFile;

public class FileUploadController extends Controller {

	public void index() {
		UploadFile uploadFile = getFile("artpic", "", 10 * 1024 * 1024, "UTF-8");
		// System.out.println(uploadFile.getFile().getAbsolutePath());
		setSessionAttr("artpic", "upload/" + uploadFile.getFileName());
		render("/WEB-INF/pages/include/center.jsp");
	}

	public void kind() {
		UploadFile uploadFile = getFile("artpic", "", 10 * 1024 * 1024, "UTF-8");
		renderJson("upload/" + uploadFile.getFileName());
	}

}
